@using Microsoft.AspNetCore.Components.Forms
@using System.ComponentModel.DataAnnotations

<EditForm Model="@model">
    <DataAnnotationsValidator />
    <MduiTextField Label="文本框" FloatingLabel Required @bind-Value="@model.Text" />
    <MduiNumbericField Label="数字框" Required @bind-Value="@model.Number" />
    <MduiField Label="单项选择">
        <MduiSelect Required @bind-Value="@model.Select">
            <option value="">请选择</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
        </MduiSelect>
    </MduiField>
    <MduiButton Color="@Colors.Theme.Primary" ButtonType="@ButtonType.Submit">提交</MduiButton>
    <MduiButton Color="@Colors.Theme.Accent" ButtonType="@ButtonType.Reset">重置</MduiButton>
</EditForm>

@code {
    private ModelInfo model = new ModelInfo();

    class ModelInfo
    {
        public string? Text { get; set; } = "test";

        public int Number { get; set; }

        public string Select { get; set; } = "";
    }
}
